﻿using System;
using System.Data;
using System.Collections.Generic;
using LTP.Common;
using Ankin.EHBH.Model;

namespace Ankin.EHBH.BLL
{
    /// <summary>
    /// 销售商
    /// </summary>
    public class BllSell
    {
        private readonly Ankin.EHBH.DAL.DalEXP_SELL dalsell = new Ankin.EHBH.DAL.DalEXP_SELL();
        public BllSell()
        { }
        /// <summary>
        /// 更新销售商一条数据
        /// </summary>
        public void SellUpdate(Ankin.EHBH.Model.ModelSell model)
        {
            dalsell.Update(model);
        }
        /// <summary>
        /// 得到销售商的一个实体
        /// </summary>
        /// <param name="CODE"></param>
        /// <returns></returns>
        public Ankin.EHBH.Model.ModelSell GetSellmodel(string CODE)
        {
            return dalsell.GetModel(CODE);
        }
        /// <summary>
        /// 增加销售商一条信息
        /// </summary>
        /// <param name="model"></param>
        public void SellAdd(Ankin.EHBH.Model.ModelSell model)
        {
            dalsell.Add(model);
        }
        /// <summary>
        /// 获得销售商数据列表
        /// </summary>
        /// <returns></returns>
        public DataSet GetAllSellList()
        {
            return GetsellList("");
        }
        /// <summary>
        /// 获取销售商数据列表
        /// </summary>
        /// <returns></returns>
        public DataSet GetsellList(string strWhere)
        {
            return GetList("");
        }
        /// <summary>
        /// 获取销售商数据列表
        /// </summary>
        /// <returns></returns>
        public DataSet GetList(string strWhere)
        {
            return dalsell.GetList(strWhere);
        }
        /// <summary>
        /// 查询获取数据列表
        /// </summary>
      
        public DataSet GetSearchSellList(string where)
        {
            return dalsell.GetList(where);
        }
        /// <summary>
        /// 删除销售商一条数据
        /// </summary>
        /// <param name="CODE"></param>
        public void DelSell(string CODE)
        {

            dalsell.Delete(CODE);
        }
        /// <summary>
        /// 验证消耗品中含有该供应商的产品
        /// </summary>
        /// <param name="Sell"></param>
        /// <returns></returns>
        public bool CheckSell(string Sell)
        {
            return dalsell.ExistesOfSell(Sell);
        }
        /// <summary>
        /// 调用SEL验证数据中该值在数据库中是否已存在
        /// </summary>
        /// <param name="Name"></param>
        /// <returns></returns>
        public bool GetSellTrue(string Name)
        {
            return dalsell.Exist(Name);
        }

        public DataSet GetAllSellTypeData()
        {
            return dalsell.GetAllSellTypeData();

        }
    }
}
